package cn.javass.dp.command.example1;

/**
 *  具体命令实现对象
 */
public class ConcreteCommand implements  Command {

    /**
     * 持有相应的接受者对象
     */
    private Receiver receiver = null;

    /**
     * 示意，命令对象可以有自己的状态
     */
    private String state;

    public ConcreteCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        //通常会转调对象的相应方法，让接受者来真正的执行
        receiver.action();
    }
}
